package com.wang.vedio.adapter.index;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.MultiTransformation;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wang.vedio.R;
import com.wang.vedio.bean.BannerBean;
import com.wang.vedio.net.rxjava.HttpMethods;

import java.util.List;

public class GameAdapter extends BaseQuickAdapter<BannerBean, BaseViewHolder> {
    public GameAdapter(int layoutResId, @Nullable List<BannerBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BannerBean item) {
        ImageView imageViewAd = helper.getView(R.id.image);
        Glide.with(imageViewAd)
                .load(HttpMethods.BASE_URL+item.getAdImg())
                .apply(RequestOptions.bitmapTransform(new MultiTransformation<>(new CenterCrop(), new RoundedCorners(30))))
                .into(imageViewAd);
    }
}
